﻿@model IEnumerable<MvcApplication6.Models.MenuL1Model>
@using MvcApplication6.Models

@section scripts{
    <script type="text/javascript">
        $(document).ready(function () {
           // $("#animatedgif").hide();
        });
        function myonbegin() {
            //show animated gif
            //alert("helloworld");
            //$("#animatedgif").show();
        }
        function myonsuccess() {
            //disable animated gif
            //window.location.href = "localhost:54094";
        }
        function myonfailure() {
            //disbale animated gif
            alert("Delete không thành công");
        }
        function myoncomplete() {
            //disable animated gif
           // $("#animatedgif").hide();
        }
    </script>
}


<div class="header">
		<div class="logo"><a href="http://aptechpro.vn/" title="CÔNG TY TNHH TM DV KT CÔNG NGHỆ AN PHÚ"><img src="http://aptechpro.vn/Content/images/LOGO.jpg"></a></div>
		<div class="address">
        	<h1>CÔNG TY TNHH TM DV KT CÔNG NGHỆ AN PHÚ</h1>
            <p>Tru sở chính: 18/2 Đường số 14, P. BHHA, Q. Bình Tân<br>
            <span>Chi Nhánh: 174 Tô Hiệu, P. Hiệp Tân, Q. Tân Phú </span><br>
            ĐT: (08) 39 722 991 - (08) 6 6767 728 <span>(8h - 17h)</span></p>
        </div>
		<div class="slogan">Hotline: <span>0906 804 828</span></div>
    	<div class="nav-small">
			<ul>
			<li><a href="http://aptechpro.vn/"  class="active">Trang chủ</a></li>

            <li>
            @*@Ajax.ActionLink(
            "Giới thiệu",
            "IntroduceCompany",
            new
            {
                Id = 78
            },
            new AjaxOptions
            {
                HttpMethod = "GET",
                InsertionMode = InsertionMode.Replace,
                UpdateTargetId = "listProduct",
                OnSuccess = "myonsuccessCallServer"
            }
            )*@

                <a href="/Home/NewDetail/giớithiệu/78">Giới thiệu</a>
            </li>
			
           
			<li>
             @*@Ajax.ActionLink(
             "Tin tức và Sự kiện",
            "New",
            new
            {
                Id = 1,
                Page = 1
            },
            new AjaxOptions
            {
                HttpMethod = "GET",
                InsertionMode = InsertionMode.Replace,
                UpdateTargetId = "listProduct",
                OnSuccess = "myonsuccessCallServer"
            }
            )*@
            <a href="/Home/TinTuc/TinTucVaSuKien">Tin tức và Sự kiện</a>
            </li>

            <li>
            @* @Ajax.ActionLink(
             "Đối tác",
            "New",
            new
            {
                Id = 8,
                Page = 1
            },
            new AjaxOptions
            {
                HttpMethod = "GET",
                InsertionMode = InsertionMode.Replace,
                UpdateTargetId = "listProduct",
                OnSuccess = "myonsuccessCallServer"
            }
            )*@
            <a href="/Home/DoiTac/ĐốiTác">Đối tác</a>
            </li>

            <li>
             @*@Ajax.ActionLink(
             "Tin khuyến mãi",
            "Sale",
            new AjaxOptions
            {
                HttpMethod = "GET",
                InsertionMode = InsertionMode.Replace,
                UpdateTargetId = "listProduct",
                OnSuccess = "myonsuccessCallServer"
            }
            )*@
            <a href="/Home/Sale/TinKhuyếnMãi">Tin Khuyến Mãi</a>
            </li>

			

            @if (Session["checkLoginAbcuser"] != null)
            {
                
                <li>
                    @Html.ActionLink("Tạo sản phẩm", "AddProduct", "Admin", null, null)
                    @*<a id="" href="Admin/AddProduct"  >Tạo sản phẩm</a>*@
                </li>
                <li>
                    @Html.ActionLink("Tạo menu cấp 1", "AddMenuL1", "Admin", null, null)
                    @*<a id="" href="Admin/AddMenuL1" >Tạo menu cấp 1</a>*@
                </li>
               @* <li><a id="" href="Admin/AddNews" >Tạo Event</a></li>*@
                <li>
                    @Html.ActionLink("Upload Image", "UploadFile", "Admin", null, null)
                    @*<a id="" href="admin/UploadFile"  >Upload Image</a>*@
                </li>
                <li>
                     @Html.ActionLink("Quản lý sale", "SalePerson", "SalePerson", null, null)
                    @*<a id="" href="SalePerson/SalePerson"  >Quản lý sale</a>*@
                </li>
                <li>
                    @Html.ActionLink("menu left", "categoryEvent", "CategoryEvent", null, null)
                    @*<a id="" href="CategoryEvent/categoryEvent"  >menu left</a>*@
                </li>
                <li>
                    @Html.ActionLink("Quản lý hình ảnh", "", "Image", null, null)
                    @*<a id="" href="Image"  >Quản lý hình ảnh</a>*@
                </li>
                
                
               @* @Html.ActionLink("Tạo sản phẩm",
                         "AddProduct",   // <-- ActionMethod
                    "Admin",  // <-- Controller Name.
                    null, // <-- Route arguments.
                    null
                    )*@

              @*  @Html.ActionLink("Tạo menu cấp 1",
                              "AddMenuL1",   // <-- ActionMethod
                    "Admin",  // <-- Controller Name.
                    null, // <-- Route arguments.
                    null
                    )*@

             @*   @Html.ActionLink("Tạo Event",
                              "AddNews",   // <-- ActionMethod
                    "Admin",  // <-- Controller Name.
                    null, // <-- Route arguments.
                    null
                    )*@

               @* @Html.ActionLink("Upload Image",
                    "UploadFile",   // <-- ActionMethod
                    "Admin",  // <-- Controller Name.
                    null, // <-- Route arguments.
                    null
                    )*@

                @* @Html.ActionLink("Quản lý sale",
                            "SalePerson",   // <-- ActionMethod
                        "SalePerson",  // <-- Controller Name.
                    null, // <-- Route arguments.
                    null
                    )*@

             @*    @Html.ActionLink("menu left",
                        "categoryEvent",   // <-- ActionMethod
                        "CategoryEvent",  // <-- Controller Name.
                    null, // <-- Route arguments.
                    null
                    )
                *@
                
                
                
                
            }
            
            <li>
           @*  @Ajax.ActionLink(
            "Dịch vụ",
            "New",
            new
            {
                Id = 2,
                Page = 1
            },
            new AjaxOptions
            {
                HttpMethod = "GET",
                InsertionMode = InsertionMode.Replace,
                UpdateTargetId = "listProduct",
                OnSuccess = "myonsuccessCallServer"
            }, new { @class = "end" }
            )*@
            <a href="/Home/DichVu/DịchVụ" style="border:none;">Dịch Vụ</a>
            </li>

			
			</ul>
		</div>
		<div class="clear"></div>
		<div class="nav-bar">

        @foreach (var model1 in Model)
        { 
                    <div class="nav-item">
			            <span>

                                @*@Ajax.ActionLink(
                                 @model1.Name,
                                "GetProductByIdL",
                                new
                                {
                                    LevelMenu = 1,
                                    Id = @model1.Id,
                                    page = 1,
                                    TitleMenu = @model1.Name,
                                    MenuId1 = @model1.Id,
                                    MenuId2 = 0,
                                    MenuId3 = 0
                                },
                                new AjaxOptions
                                {
                                    HttpMethod = "GET",
                                    InsertionMode = InsertionMode.Replace,
                                    UpdateTargetId = "listProduct",
                                    OnSuccess = "myonsuccessCallServer"
                                }
                                )*@

                            @*    @Html.ActionLink(@model1.Name,
                                    "GetProductByIdL2",
                                    new
                                    {
                                        LevelMenu = 1,
                                        Ids = @model1.Id,
                                        page = 1,
                                        TitleMenu = @model1.Name,
                                        MenuId1 = @model1.Id,
                                        MenuId2 = 0,
                                        MenuId3 = 0
                                    }
                                    , null)*@

                            @*    @Url.Action(@model1.Name, "GetProduct", new RouteValueDictionary(
                                        new {
                                            TitleMenu = @model1.Name,
                                            LevelMenu = 1,
                                            Ids = @model1.Id,
                                            page = 1,
                                            MenuId1 = @model1.Id,
                                            MenuId2 = 0,
                                            MenuId3 = 0
                                        }));*@

                                <a href="/Home/GetProduct/A/1/@model1.Id/1/@model1.Id/0/0/@model1.Name.Replace(" ", "-")">@model1.Name</a>
                                   

                             
@*
                                @Ajax.ActionLink(
                                 "X",
                                "DeleteMenu",
                                new
                                {
                                    LevelMenu = 1,
                                    Id = @model1.Id
                                },
                                new AjaxOptions
                                {
                                    HttpMethod = "GET",
                                    InsertionMode = InsertionMode.Replace,
                                    OnSuccess = "myonsuccess",
                                    OnFailure = "myonfailure"
                                }
                                )

                                *@


                                 @if (Session["checkLoginAbcuser"] != null)
                                 {   
                                        @*<a  href="Admin/EditMenuL1?MenuId=@model1.Id" >|S</a>
                                         <a  href="Admin/AddMenuL2?Id_l1=@model1.Id&menu1Name=@model1.Name" >|A2</a>
                                        <a  href="Admin/SaleAll?IdSale=@model1.Id&MenuLV=1" >|Sale</a>*@
                                     
                                      @Html.ActionLink("|E",
                                                "EditMenuL1",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                MenuId = @model1.Id
                                            }, // <-- Route arguments.
                                            null
                                            )

                                     @Html.ActionLink("|A",
                                                     "AddMenuL2",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                Id_l1 = @model1.Id,
                                                menu1Name = @model1.Name
                                            }, // <-- Route arguments.
                                            null
                                            )

                                    @* @Html.ActionLink("Sale",
                                            "SaleAll",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                IdSale = @model1.Id,
                                                MenuLV = 1
                                            }, // <-- Route arguments.
                                            null
                                            )*@
                                     
                                 }
                                

                   
                        </span>

                    @if (model1.MenuL2ModelList.Count > 0)
                    {
                        <div class="nav-group">
                         @foreach (var model2 in model1.MenuL2ModelList)
                         { 
                             <div class="nav-sub-item">
                             <span>
                                @*@Ajax.ActionLink(
                                 @model2.Name,
                                "GetProductByIdL",
                                new
                                {
                                    LevelMenu = 2,
                                    Id = @model2.Id,
                                    page = 1,
                                    TitleMenu = @model2.Name,
                                    MenuId1 = @model1.Id,
                                    MenuId2 = @model2.Id,
                                    MenuId3 = 0
                                },
                                new AjaxOptions
                                {
                                    HttpMethod = "GET",
                                    InsertionMode = InsertionMode.Replace,
                                    UpdateTargetId = "listProduct",
                                    OnSuccess = "myonsuccessCallServer"
                                }
                                )*@

                          @*      @Html.ActionLink(@model2.Name,
                                    "GetProductByIdL2",
                                    new
                                    {
                                        LevelMenu = 2,
                                        Ids = @model2.Id,
                                        page = 1,
                                        TitleMenu = @model2.Name,
                                        MenuId1 = @model1.Id,
                                        MenuId2 = @model2.Id,
                                        MenuId3 = 0
                                    }
                                    , null)*@

                                <a href="/Home/GetProduct/A/2/@model2.Id/1/@model1.Id/@model2.Id/0/@model2.Name.Replace(" ", "-")">@model2.Name</a>
@*
                                @Ajax.ActionLink(
                                 "X",
                                "DeleteMenu",
                                new
                                {
                                    LevelMenu = 2,
                                    Id = @model1.Id
                                },
                                new AjaxOptions
                                {
                                    HttpMethod = "GET",
                                    InsertionMode = InsertionMode.Replace,
                                    OnSuccess = "myonsuccess",
                                    OnFailure = "myonfailure"
                                }
                                )

                                
*@
                                @if (Session["checkLoginAbcuser"] != null)
                                {   
                                    @* <a  href="Admin/EditMenuL2?MenuId=@model2.Id" >|Sửa</a>
                                        <a  href="Admin/AddMenuL3?Id_l2=@model2.Id&menu2Name=@model2.Name" >|A3</a>
                                    <a  href="Admin/SaleAll?IdSale=@model2.Id&MenuLV=2" >|Sale</a>*@
                                    
                                    
                                    @Html.ActionLink("|E",
                                                     "EditMenuL2",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                MenuId = @model2.Id
                                            }, // <-- Route arguments.
                                            null
                                            )

                                     @Html.ActionLink("|A",
                                                         "AddMenuL3",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                Id_l2 = @model2.Id,
                                                menu2Name = @model2.Name
                                            }, // <-- Route arguments.
                                            null
                                            )

                                     @Html.ActionLink("|S",
                                            "SaleAll",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                IdSale = @model2.Id,
                                                MenuLv = 2,
                                                NameMenu = @model2.Name
                                            }, // <-- Route arguments.
                                            null
                                            )

                                     @Html.ActionLink("|X",
                                        "DeleteMenu",   // <-- ActionMethod
                                        "Admin",  // <-- Controller Name.
                                        new
                                        {
                                            LevelMenu = 2,
                                            Ids = @model2.Id
                                        }, // <-- Route arguments.
                                        null
                                        )
                                
                                }
                               


                                </span>
                              @if (model2.MenuL3ModelList.Count > 0)
                              {
                                <div class="nav-sub-group">
                                    @foreach (var model3 in model2.MenuL3ModelList)
                                    {
                                        if (!"123456".Equals(@model3.Name.ToLower()))
                                        {
                                            <div class="nav-lev-item">
                                                <span>
                                                    @*@Ajax.ActionLink(
                                                             @model3.Name,
                                                        "GetProductByIdL",
                                                        new
                                                        {
                                                            LevelMenu = 3,
                                                            Id = @model3.Id,
                                                            page = 1,
                                                            TitleMenu = @model3.Name,
                                                            MenuId1 = @model1.Id,
                                                            MenuId2 = @model2.Id,
                                                            MenuId3 = @model3.Id
                                                        },
                                                        new AjaxOptions
                                                        {
                                                            HttpMethod = "GET",
                                                            InsertionMode = InsertionMode.Replace,
                                                            UpdateTargetId = "listProduct",
                                                            OnSuccess = "myonsuccessCallServer"
                                                        }
                                                        )*@
                                                    @*
                                                        @Html.ActionLink(@model3.Name,
                                                           "GetProductByIdL2",
                                                           new
                                                           {
                                                               LevelMenu = 3,
                                                               Ids = @model3.Id,
                                                               page = 1,
                                                               TitleMenu = @model3.Name,
                                                               MenuId1 = @model1.Id,
                                                               MenuId2 = @model2.Id,
                                                               MenuId3 = @model3.Id
                                                           }
                                                           , null)*@

                                                    <a href="/Home/GetProduct/A/3/@model3.Id/1/@model1.Id/@model2.Id/@model3.Id/@model3.Name.Replace(" ", "-")">@model3.Name</a>




                                                    @if (Session["checkLoginAbcuser"] != null)
                                                    {
                                                        @*<a  href="Admin/EditMenuL3?MenuId=@model3.Id">|Sửa</a>
                                                            <a  href="Admin/SaleAll?IdSale=@model3.Id&MenuLV=3" >|Sale</a>*@


                                                        @Html.ActionLink("|E",
                                                                 "EditMenuL3",   // <-- ActionMethod
                                                        "Admin",  // <-- Controller Name.
                                                        new
                                                        {
                                                            MenuId = @model3.Id
                                                        }, // <-- Route arguments.
                                                        null
                                                        )


                                                        @Html.ActionLink("|S",
                                                        "SaleAll",   // <-- ActionMethod
                                                        "Admin",  // <-- Controller Name.
                                                        new
                                                        {
                                                            IdSale = @model3.Id,
                                                            MenuLv = 3,
                                                            NameMenu = @model3.Name
                                                        }, // <-- Route arguments.
                                                        null
                                                        )

                                                        @Html.ActionLink("|X",
                                                        "DeleteMenu",   // <-- ActionMethod
                                                        "Admin",  // <-- Controller Name.
                                                        new
                                                        {
                                                            LevelMenu = 3,
                                                            Ids = @model3.Id
                                                        }, // <-- Route arguments.
                                                        null
                                                        )


                                                    }

                                                </span>
                                            </div>

                                        }
                                        else
                                        {
                                            <div class="nav-lev-item-new">
                                                <span>
                                                    @if (Session["checkLoginAbcuser"] != null)
                                                    {
                                                        @*<a  href="Admin/EditMenuL3?MenuId=@model3.Id">|Sửa</a>
            <a  href="Admin/SaleAll?IdSale=@model3.Id&MenuLV=3" >|Sale</a>*@


                                                        @Html.ActionLink("|E",
                                                                 "EditMenuL3",   // <-- ActionMethod
                                                        "Admin",  // <-- Controller Name.
                                                        new
                                                        {
                                                            MenuId = @model3.Id
                                                        }, // <-- Route arguments.
                                                        null
                                                        )


                                                        @Html.ActionLink("|S",
                                                        "SaleAll",   // <-- ActionMethod
                                                        "Admin",  // <-- Controller Name.
                                                        new
                                                        {
                                                            IdSale = @model3.Id,
                                                            MenuLv = 3,
                                                            NameMenu = @model3.Name
                                                        }, // <-- Route arguments.
                                                        null
                                                        )

                                                        @Html.ActionLink("|X",
                                                        "DeleteMenu",   // <-- ActionMethod
                                                        "Admin",  // <-- Controller Name.
                                                        new
                                                        {
                                                            LevelMenu = 3,
                                                            Ids = @model3.Id
                                                        }, // <-- Route arguments.
                                                        null
                                                        )


                                                    }
                                                </span>
                                            </div>
                                        }


                                    }
                                </div>

                              }


                             </div>
                         
                         }
                         </div>
                    
                    }
                     </div>
                
        }
	
		</div>
	</div>

